﻿<%@ Page Title="User Master" Language="C#" MasterPageFile="~/AuditBillingMaster.master" AutoEventWireup="true" CodeFile="UserMaster.aspx.cs" Inherits="UserMaster" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script src="../JS/Forms/jsUserMaster.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cntList" runat="Server">
    <asp:HiddenField runat="server" ID="hdnExportToExcelFilePath" ClientIDMode="Static" />
    <input type="hidden" id="hdnUserID" runat="server" value="0" clientidmode="Static" />
    <div class="pagecontent">
        <div class="headercontainer">
            <div class="headertextcontainer halfpanel">
                User Master
            </div>
            <div class="headerbuttoncontainer halfpanel">
                <a id="A1" href='javascript:void(0);' onclick="toggle_TopContainer();" tabindex="5" class="headersearchbutton" title="Toggle Search Panel" runat="server">Search</a>&nbsp;&nbsp;<a
                    runat="server" href='javascript:void(0);' id="lnkAdd" tabindex="6" clientidmode="Static" class="headeraddbutton" title="Add User"
                    onclick='javascript:ShowEditDiv(0,this);'>Add User</a>
                <a href="#" onclick="fn_ExportToExcel();" class="headerexportbutton">Export To Excel</a>

            </div>
        </div>
        <div id="divTopContainer" class="topcontainerwrapper">
            <div class="topcontainerSmall" onkeypress="javascript:return fireDefaultButton(event, 'btnSearch')">
                <div class="halfpanel">
                    <div class="row">
                        <asp:TextBox ID="txtSearchUserName" runat="server" ClientIDMode="Static" MaxLength="50"
                            TabIndex="1" CssClass="searchCntrl" placeholder="User Name"></asp:TextBox>
                    </div>
                </div>
                <div class="halfpanel">
                    <div class="row">
                        <asp:DropDownList ID="cboStatus" ClientIDMode="Static" runat="server" TabIndex="2"
                            CssClass="searchCntrl" Width="70%">
                            <asp:ListItem Value="2" Text="Both"></asp:ListItem>
                            <asp:ListItem Value="1" Text="Active"></asp:ListItem>
                            <asp:ListItem Value="0" Text="InActive"></asp:ListItem>
                        </asp:DropDownList>
                    </div>
                </div>
                <div class="fullpanel textalignright">
                    <a tabindex="3" class="btn-search-clear" onclick="clear_form_elements('divTopContainer');" onkeypress="clear_form_elements_ForTab(event,'divTopContainer');" href="javascript:void(0);">Clear</a>
                    <input type="button" id="btnSearch" tabindex="3" class="btn-search" onclick="javascript: return fn_GetSearchResult(0);"
                        value="Search" title="Search" />
                </div>
            </div>
            <a href='javascript:void(0);' class="closedivSmall" onclick="toggle_TopContainer();" title="Toggle Search Panel" tabindex="4"><i class="fa fa-chevron-up"></i></a>
        </div>
        <div class="maincontainer">
            <div class="listpagediv" id="divResult">
                <asp:GridView ID="grdResult" runat="server" ClientIDMode="Static" AutoGenerateColumns="false" Width="57%" CssClass="listdiv" DataKeyNames="UserID" OnRowDataBound="grdResult_RowDataBound">
                    <Columns>
                        <asp:BoundField DataField="UserID" HeaderText="User ID" />
                        <asp:BoundField DataField="UserLoginPassword" HeaderText="UserLoginPassword" />
                        <asp:BoundField HeaderText="Sr." ItemStyle-HorizontalAlign="Center" />
                        <asp:TemplateField HeaderText="Action" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <a class="btn-edit" href="javascript:void(0);" onclick="return ShowEditDiv(1,this);" title="Edit"><i class="fa fa-pencil" title="Edit"></i></a>
                                <%--  &nbsp;&nbsp;&nbsp;&nbsp;
                                <a class="btn-edit" href="javascript:void(0);" onclick="return ShowEditDiv(1,this);" title="Pages"><i class="fa fa-wrench" title="Edit"></i></a>--%>

                                <%--<a class="btn-edit" href="javascript:void(0);" onclick="<%# string.Concat("return ShowEditDiv(",Eval("MstUserID"),"'", Eval("UserFullName"),"');")%>" title="Edit"><i class="fa fa-pencil" title="Edit"></i></a>
                                &nbsp;&nbsp;&nbsp;&nbsp;
                                <a class="btn-edit" href="javascript:void(0);" onclick="<%# string.Concat("return ShowEditDiv(",Eval("MstUserID"),"'", Eval("UserFullName"),"');")%>" title="Pages"><i class="fa fa-wrench" title="Edit"></i></a>--%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="UserFirstName" HeaderText="First Name" />
                        <asp:BoundField DataField="UserLastName" HeaderText="Last Name" />
                        <asp:BoundField DataField="UserEmail" HeaderText="Email Id" />
                        <asp:TemplateField HeaderText="Status" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <%#(Convert.ToBoolean(Eval("IsActive")) == true ? "Active" : "InActive") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </div>

        </div>
    </div>
    <div class="modalopenConfirmDel modalopenUser" style="display: none;">
    </div>

    <div id="divInsertEdit" class="modalUser" onkeypress="javascript:return fireDefaultButton(event, 'btnSave')">
        <div class="form">
            <div class="innercontent">
                <div class="row">
                    <div class="midium-label">
                        User First Name&nbsp;&nbsp;<span class="red">*</span>
                    </div>
                    <div class="midium-value">
                        <asp:TextBox ID="txtFirstName" runat="server" ClientIDMode="Static" Width="97%"
                            MaxLength="50" placeholder="Enter First Name" CssClass="input" TabIndex="101"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvtxtFirstName" runat="server" Display="Dynamic" ClientIDMode="Static"
                            ControlToValidate="txtFirstName" ValidationGroup="vgSave" ErrorMessage="Enter First Name"
                            Width="90%"><span class="error">Enter first name</span></asp:RequiredFieldValidator>
                        <asp:CustomValidator ID="cvtxtFirstName" runat="server" ClientIDMode="Static" ControlToValidate="txtFirstName"
                            ClientValidationFunction="fn_ValidateExpressionTextbox" ValidationGroup="vgSave" ValidateEmptyText="false" expressionid="Alp"
                            Display="Dynamic" Width="90%"><span id="spnFirstName" class="error"></span></asp:CustomValidator>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="row">
                    <div class="midium-label">
                        User Last Name&nbsp;&nbsp;<span class="red">*</span>
                    </div>
                    <div class="midium-value">
                        <asp:TextBox ID="txtLastName" runat="server" ClientIDMode="Static" Width="97%"
                            MaxLength="50" placeholder="Enter Last Name" CssClass="input" TabIndex="102"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvtxtLastName" runat="server" Display="Dynamic" ClientIDMode="Static"
                            ControlToValidate="txtLastName" ValidationGroup="vgSave" ErrorMessage="Enter Last Name"
                            Width="90%"><span class="error">Enter last name</span></asp:RequiredFieldValidator>
                        <asp:CustomValidator ID="cvtxtLastName" runat="server" ClientIDMode="Static" ControlToValidate="txtLastName"
                            ClientValidationFunction="fn_ValidateExpressionTextbox" ValidationGroup="vgSave" ValidateEmptyText="false" expressionid="Alp"
                            Display="Dynamic" Width="90%"><span id="spnLastName" class="error"></span></asp:CustomValidator>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="row">
                    <div class="midium-label">
                        User Email ID&nbsp;&nbsp;<span class="red">*</span>
                    </div>
                    <div class="midium-value">
                        <asp:TextBox ID="txtEmailId" runat="server" ClientIDMode="Static" Width="97%"
                            MaxLength="50" placeholder="Enter Email Id" CssClass="input" TabIndex="102"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvtxtEmailId" runat="server" Display="Dynamic" ClientIDMode="Static"
                            ControlToValidate="txtEmailId" ValidationGroup="vgSave" ErrorMessage="Enter Last Name"
                            Width="90%"><span class="error">Enter email id</span></asp:RequiredFieldValidator>
                        <asp:CustomValidator ID="cvtxtEmailId" runat="server" ClientIDMode="Static" ControlToValidate="txtEmailId"
                            ClientValidationFunction="fn_ValidateExpressionTextbox" ValidationGroup="vgSave" ValidateEmptyText="false" expressionid="Email"
                            Display="Dynamic" Width="90%"><span id="spnEmailId" class="error"></span></asp:CustomValidator>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="row">
                    <div class="midium-label">
                        User Password&nbsp;&nbsp;<span class="red">*</span>
                    </div>
                    <div class="midium-value">
                        <asp:TextBox ID="txtPassword" runat="server" ClientIDMode="Static" Width="97%"
                            MaxLength="50" placeholder="Enter Password" CssClass="input" TabIndex="102"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvtxtPassword" runat="server" Display="Dynamic" ClientIDMode="Static"
                            ControlToValidate="txtPassword" ValidationGroup="vgSave" ErrorMessage="Enter Password"
                            Width="90%"><span class="error">Enter password</span></asp:RequiredFieldValidator>
                        <asp:CustomValidator ID="cvtxtPassword" runat="server" ClientIDMode="Static" ControlToValidate="txtPassword"
                            ClientValidationFunction="fn_ValidateExpressionTextbox" ValidationGroup="vgSave" ValidateEmptyText="false" expressionid="AlpNumSplChar"
                            Display="Dynamic" Width="90%"><span id="spnPassword" class="error"></span></asp:CustomValidator>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="row">
                    <div class="midium-label">
                        Active
                    </div>
                    <div class="midium-value label">
                        <asp:CheckBox ID="chkActive" ClientIDMode="Static" runat="server" TabIndex="8" />
                    </div>
                </div>
                <div class="clear">
                </div>
                <div class="pagefooter">
                    <center>
                        <input type="button" id="btnSave" onclick="javascript: return fn_SaveDetails();"
                            tabindex="9" value="Save" validationgroup="vgSave" class="btn-primary" />
                    </center>
                </div>
            </div>
        </div>
    </div>

    <div id="divChangePages" class="modalUser" onkeypress="javascript:return fireDefaultButton(event, 'btnSaveRights')">
        <div class="form">
            <div class="innercontent">
                <div class="row">
                    <div class="listpagediv">
                        <asp:GridView ID="grdPageRights" runat="server" ClientIDMode="Static" CssClass="listdiv" AutoGenerateColumns="false">
                            <Columns>
                                <asp:BoundField DataField="FormName" HeaderText="Page" />
                                <asp:CheckBoxField HeaderText="Global Access" DataField="GlobalAccess" ItemStyle-HorizontalAlign="Center" />
                                <asp:CheckBoxField HeaderText="Add / Edit Access" DataField="AddEditAccess" ItemStyle-HorizontalAlign="Center" />
                                <asp:CheckBoxField HeaderText="View Access" DataField="ViewAccess" ItemStyle-HorizontalAlign="Center" />
                            </Columns>
                        </asp:GridView>
                    </div>
                </div>
                <div class="clear">
                </div>
                <div class="pagefooter">
                    <center>
                        <input type="button" id="btnSaveRights" onclick="javascript: return fn_SavePageRights();"
                            tabindex="9" value="Save" validationgroup="vgSave" class="btn-primary" />
                    </center>
                </div>
            </div>
        </div>
    </div>

</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cntMain" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="FootContent" runat="Server">
</asp:Content>

